import { request, config } from 'utils'

const { api } = config
const { user, menuListAll, menuListSub, menuFindByID } = api

export async function menuQueryAll () {
  return request({
    url: menuListAll,
    method: 'get',
    data: {
      ID: 1,
    },
  })
}

export async function menuQuerySub (params) {
  return request({
    url: menuListSub,
    method: 'get',
    data: params,
  })
}

export async function menuQuery (params) {
  return request({
    url: menuFindByID,
    method: 'get',
    data: params,
  })
}

export async function menucreate (params) {
  return request({
    url: user.replace('/:id', ''),
    method: 'post',
    data: params,
  })
}

export async function menuremove (params) {
  return request({
    url: user,
    method: 'delete',
    data: params,
  })
}

export async function menuupdate (params) {
  return request({
    url: user,
    method: 'patch',
    data: params,
  })
}

